export default {
  // 侧边栏的收缩
  changeCollapsed(state,flag){  
    state.collapsed = flag
  },
  setLogo(state, url){
    state.logo = url
    localStorage.setItem('logo', url)
  },
  //侧边栏列表
  setRightList (state, data) {
    state.rightList = data
    sessionStorage.setItem('rightList', JSON.stringify(data))
  },

  // 用户信息
  setUserInfo (state, data) {
    state.userInfo = data
    sessionStorage.setItem('userInfo', JSON.stringify(data))
  },
  changeUserInfo(state,options){
    state.userInfo = {...state.userInfo,...options}
    sessionStorage.setItem('userInfo', JSON.stringify(state.userInfo))
  },

  //退出登录  清除所有登录信息
  claerInfo(state){
    state.rightList = []
    state.userInfo = {}
  },

  //设置一级科室信息
  setCacheDepartments(state, data){
    state.cacheDepartments = data
  },
  // //设置二级科室信息
  // setCacheSubDepartments(state, data){
  //   state.cacheSubDepartments = data
  // },
  // //设置角色列表
  // setCacheRoulsList(state, data){
  //   state.cacheRoulsList = data
  // }
};
